<?php
class carousel
{
  public $img=array(); 

  public function run()
  {

  echo'<div id="slideshow" class="carousel slide" data-ride="carousel" >
    <!-- Indicators -->
    <ol class="carousel-indicators">
        <li data-target="#slideshow" data-slide-to="0" class="active"></li>
        <li data-target="#slideshow" data-slide-to="1"></li>
        <li data-target="#slideshow" data-slide-to="2"></li>
    </ol>
    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">';
        foreach ($this->img as $index=>$image) 
      {
       
        if($index == 0)
        {

        echo'<div class="item active" >
            <img src="'. $image .'" alt="hydra" class="img-responsive">
            <div class="carousel-caption">
            <h3>TEST<h3>
            </div>
        </div>';  
        }
        elseif ($index > 0)
        {
          echo'<div class="item " >
            <img src="'. $image .'" alt="hydra" class="img-responsive">
            <div class="carousel-caption">
            <h3>TEST<h3>
            </div>
        </div>';
        }
      
      }

    echo'</div>
    <!-- Controls -->
    <a class="left carousel-control" href="#slideshow" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    <a class="right carousel-control" href="#slideshow" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
    </a>
</div>';
  }
}
	
  ?>




